<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>订单操作记录管理</title>
<style type="text/css">		
	#contentTable td ,#contentTable th{
		text-align: center;
		padding: 2px 8px;
	}
	.minWidth {
		min-width: 177px;
	}	
</style>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
	$("#btnButton").click(function(){
		$("#operationUser").val("");
		$("#orderId").val("");
		$("#orderNo").val("");
		$("#beginDate").val("");
		$("#endDate").val("");
	    $("#areaCodeId").val("");
	    $("#areaCodeName").val("");
	});
	$(document).on("click","#check",function(){
    	debugger;
    	var orderId = $(this).parent().parent().attr("data-orderId");
    	var orderNo = $(this).parent().parent().attr("data-orderNo");
    	var id = $(this).parent().parent().attr("data-id");
    	var url = "${ctx }/order_record/bsOrderOperation/orderDetailList?orderId="+orderId+"&orderNo="+orderNo+"&id="+id;
	    layer.open({
	        type: 2,
	        title: '',
	        shadeClose: true,
	        shade: 0.8,
	        area: [screen.availWidth * 0.7 + 'px', screen.availHeight * 0.6 + 'px' ],
	        content: url 
	      });
    });
});
function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	$("#searchForm").submit();
    return false;
}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<%-- <li class="active"><a href="${ctx}/order_record/bsOrderOperation/">订单操作记录列表</a></li> --%>
		<li class="active"><a href="#">订单操作记录列表</a></li>
		<shiro:hasPermission name="order_record:bsOrderOperation:edit"><li><a href="${ctx}/order_record/bsOrderOperation/form">订单操作记录添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="bsOrderOperation" action="${ctx}/order_record/bsOrderOperation/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div class="breadcrumb">
			<table class="table table-bordered">
				<tr>
					<th>操作人：</th>
					<td>
						<form:input path="operationUser" htmlEscape="false" maxlength="32" class="span2 minWidth"/>
					</td>
				    <th>订单ID：</th>
					<td>
						<form:input path="orderId" htmlEscape="false" maxlength="32" class="span2 minWidth"/>
					</td>
					<th>订单号：</th>
					<td>
						<form:input path="orderNo" htmlEscape="false" maxlength="32" class="span2 minWidth"/>
					</td>
				</tr>
				<tr>
				    <th>地区</th>
					<td>
						<sys:treeselect2 id="areaCode" name="areaCode" value="${bsOrderOperation.areaCode}" labelName="areaName" labelValue="${bsOrderOperation.areaName}"
					title="机构" url="/sys/office/treeData" extId="${office.id}" cssClass="input-medium" allowClear="${office.currentUser.admin}" layer = "true"/>
					</td>
				    <th>操作起始时间：</th>
					<td>
						<input name="beginDate" id="beginDate" type="text" readonly="readonly" maxlength="20" class="span2 minWidth Wdate"
					       value="<fmt:formatDate value="${bsOrderOperation.beginDate}" pattern="yyyy-MM-dd"/>"
					       onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
					</td>
					<th>操作结束时间：</th>
					<td>
						<input name="endDate" id="endDate" type="text" readonly="readonly" maxlength="20" class="span2 minWidth Wdate"
					       value="<fmt:formatDate value="${bsOrderOperation.endDate}" pattern="yyyy-MM-dd"/>"
					       onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
					</td>
				</tr>
			</table>
		</div>
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		<input id="btnButton" class="btn btn-primary" type="button" value="重置"/>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>记录编号</th>
				<th>订单ID</th>
				<th>订单号</th>
				<th>操作人</th>
				<th>操作时间</th>
				<th>操作名称</th>
				<th>创建者</th>
				<th>创建时间</th>
				<shiro:hasPermission name="order_record:bsOrderOperation:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="bsOrderOperation" begin="0" varStatus="status">
			<tr data-orderId="${bsOrderOperation.orderId}" data-orderNo="${bsOrderOperation.orderNo}" data-id="${bsOrderOperation.id}">
				<td>${(page.pageNo-1)*page.pageSize+status.index+1 }</td>
				<td>
					${bsOrderOperation.orderId}
				</td>
				<td>
				    <a href="javascript:;" id ="check">${bsOrderOperation.orderNo}</a>
				</td>
				<td>
					${bsOrderOperation.operationUser}
				</td>
				<td>
					<fmt:formatDate value="${bsOrderOperation.operationTime}" pattern="yyyy/MM/dd HH:mm:ss"/>
				</td>
				<td>
					${bsOrderOperation.operationName}
				</td>
				<td>
					${bsOrderOperation.createBy.id}
				</td>
				<td>
					<fmt:formatDate value="${bsOrderOperation.createDate}" pattern="yyyy/MM/dd"/>
				</td>
				<shiro:hasPermission name="order_record:bsOrderOperation:edit"><td>
    				<a href="${ctx}/order_record/bsOrderOperation/form?id=${bsOrderOperation.id}">修改</a>
					<a href="${ctx}/order_record/bsOrderOperation/delete?id=${bsOrderOperation.id}" onclick="return confirmx('确认要删除该订单操作记录吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>